package net.caixiaomi.info.Lottery.view;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;

import net.caixiaomi.info.Lottery.callback.LotteryMainCallBack;
import net.caixiaomi.info.Lottery.presenter.LotteryEasyPresenter;
import net.caixiaomi.info.R;

/**
 * Created by suntian on 2018/8/15.
 */

public class LotteryEasyBetView extends LinearLayout{

    private HorizontalBallView mBeforeView;
    private HorizontalBallView mAfterView;
    private LotteryEasyPresenter mPresenter;
    private LotteryMainCallBack mMainCallBack;

    public LotteryEasyBetView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        View view=View.inflate(context, R.layout.lottery_easy_bet_layout,null);
        addView(view);
        mBeforeView=view.findViewById(R.id.lottery_easy_before);
        mAfterView=view.findViewById(R.id.lottery_easy_after);
        mPresenter=new LotteryEasyPresenter();
        mBeforeView.initData(35,HorizontalBallView.RED_TYPE,0,mPresenter);
        mAfterView.initData(12,HorizontalBallView.BLUE_TYPE,1,mPresenter);
//        mPresenter.initStandardView(mBeforeView,mAfterView,mMainCallBack);
}

    public void setCallBack(LotteryMainCallBack callBack){
        mMainCallBack=callBack;
        mPresenter.initStandardView(mBeforeView,mAfterView,mMainCallBack);
    }

    public void clearBall(){
        mBeforeView.clearAll();
        mAfterView.clearAll();
    }

    public void addBetingData(){
        mPresenter.addBettingData();
    }

    public boolean isNoBallCheck(){
        return mPresenter.isNoBallCheck();
    }
}
